<h1>Listing profiles</h1>

<table>
  <tr>
    <th>Username</th>
    <th>First name</th>
    <th>Last name</th>
    <th>Sex</th>
    <th>Card ID</th>
    <th>City</th>
    <th>Email</th>
  </tr>

<% @profiles.each do |profile| %>
  <tr>
    <td><%=h profile.user.username %></td>
    <td><%=h profile.first_name %></td>
    <td><%=h profile.last_name %></td>
    <td><%=h Profile::SEX.index(profile.sex) %></td>
    <td><%=h profile.card_id %></td>
    <td><%=h profile.city.title %></td>
    <td><%=h profile.email %></td>
    <td><%= link_to 'Show', profile %></td>
    <td><%= link_to 'Edit', edit_profile_path(profile) %></td>
    <td><%= link_to 'Destroy', profile, :confirm => 'Are you sure?', :method => :delete %></td>
  </tr>
<% end %>
</table>

<br />

<%= link_to 'New profile', new_profile_path %>
